import { getDesignContent } from './service';

function getJsTpl() {
  return (`$udp.AllReady(function () {
    console.log('detail Ready');
}, function () {
    console.log('list Ready');
});`);
}

export async function createContentTpl() {
  const content = await getDesignContent();
  console.log('---get design content---', content);
  return {
    listInfo: content.listInfo,
    editInfo: content.editInfo,
    jsInfo: content.jsInfo || getJsTpl(),
    packages: content.editInfo?.amisPackages || content.listInfo?.amisPackages,
    id: content.id,
    loading: false,
  };
}
